{% load lbforum %}
<!-- { % load avatar_tags % } -->
<div class="post {% cycle 'odd' 'even' %} {{forloop|post_style}}" id="p{{post.pk}}">
    <div class="posthead">
        <h3 class="hn post-ident">
            <span class="post-num">{% page_item_idx page_obj forloop %}</span>
            
            <span class="post-byline">
                <span>Topic by </span>
                
                <a href="{% url user_profile post.posted_by.pk %}">{{post.posted_by.username}}</a>
                <p><img src="{% url photo post.posted_by.pk %}" alt="" width="80" height="80" /></p>
               
            </span>
            <span class="post-link">
                {{ post.created_on|timesince }} 前发表
            </span>
        </h3>
    </div>
    <div class="postbody">
        <div class="post-author">
            <ul class="author-ident">
                <li class="useravatar"><a href="{% url user_profile post.posted_by.pk %}"><!--  { % avatar post.posted_by % } --></a></li>
                <li class="username"> <a href="{% url user_profile post.posted_by.pk %}">{{post.posted_by.username}}</a> </li>
                <!--   
                <li class="usertitle"><span>Member</span></li>
                <li class="userstatus"><span>{{post.posted_by.username|online}}</span></li>
                --> 
                <!--
            </ul>
            <ul class="author-info">
                <li><span>{% trans "Registered Date" %}: <strong>{{ post.posted_by.date_joined|date:"Y-m-d" }}</strong></span></li>
                <li><span>{% trans "Total Posts" %}: <strong>{{ post.posted_by.lbforum_profile.get_total_posts  }}</strong></span></li>
                -->
            </ul>
        </div>
        <div class="post-entry">
            <div class="entry-content">
                <p>{{ post.message|bbcode|safe }}</p>
                {% if post.edited_by %}
                <p class="postedit"><em>{% trans "Last edited by" %} {{post.edited_by}} ({{post.updated_on}})</em></p>
                {% endif %}
            </div>
            {% if post.attachments.all %}
            <div class="entry-attachments">
                <b>{% trans "Attachments" %}:</b>
                <ul>
                    {% for attachment in post.attachments.all %}
                    <li>
                        <a href="{{attachment.file.url}}" target="_blank">{{ attachment.org_filename }}</a>
                        <span>{{ attachment.description }}</span>
                    </li>
                    {% endfor %}
                </ul>
            </div>
            {% endif %}
        </div>
    </div>

    {% if user.is_authenticated %}
    <div class="postfoot">
        <div class="post-options">
            <p class="post-contacts"></p>
            <p class="post-actions">
                <span class="quote-post"><a href="{% url lbforum_new_replay topic.seq %}?qid={{post.seq_in_topic}}">{% trans "quote" %}</a></span>
                <!--   
                { % if user == post.posted_by or user.is_staff % }
                <span class="edit-post"><a href="{ % url lbforum_post_edit post.topic.seq post.seq_in_topic % }">edit</a></span> 
                { % endif % }
                -->
                {% ifequal user  post.posted_by %}
                	<span class="edit-post"><a href="{% url lbforum_post_edit post.topic.seq post.seq_in_topic %}">{% trans "Edit" %}</a></span>
                {% else %}
                	{% if user.is_staff %}
                		<span class="edit-post"><a href="{% url lbforum_post_edit post.topic.seq post.seq_in_topic %}">{% trans "Edit" %}</a></span>
                	{% endif %}	 
                {% endifequal %}
            </p>
        </div>
    </div>
    {% endif %}
    
</div>
